package com.nine.system.controller;

import com.nine.common.tool.ResponseResult;
import com.nine.system.service.MoneyService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.sql.Date;

@RestController
@RequestMapping("/money")
public class MoneyController {
    @Autowired
    private MoneyService moneyService;

    @PostMapping("/findSome")
    public ResponseResult findSome(
            @ApiParam(value = "用户ID") @RequestParam(value = "sysid", required = false) String sysid,
            @ApiParam(value = "开始时间",required = true)@RequestParam("date1") Date date1,
            @ApiParam(value = "结束时间",required = true)@RequestParam("date2") Date date2
            ){

        return moneyService.findSome(sysid,date1,date2);
    }

    @PostMapping("/findOne")
    public ResponseResult findOne(
            @ApiParam(value = "订单ID") @RequestParam(value = "orderId", required = false) String orderId
    ){

        return moneyService.findOne(orderId);
    }

    @GetMapping("/getBalanceBy102")
    public ResponseResult getBalanceBy102(){
        return moneyService.getBalanceBy102();
    }

    @GetMapping("/getBalanceBy103")
    public ResponseResult getBalanceBy103(){
        return moneyService.getBalanceBy103();
    }

    @GetMapping("/getBalanceBy101")
    public ResponseResult getBalanceBy101(){
        return moneyService.getBalanceBy101();
    }
}
